package com.bwie.controller;

import com.bwie.pojo.TUser;
import com.bwie.service.TUserService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;

/**
 * @Author: badaotianqiong
 * @Date: 2025/6/26 09:57
 * @Description:
 **/
@RestController
@RequestMapping("/user/index")
public class UserController {
    @Autowired
    private TUserService tUserService;

    @PostMapping("login")
    public R login(@RequestBody TUser tUser){
        return tUserService.login(tUser);
    }

    @PostMapping("getSoftList")
    public R getSoftList(@RequestBody PageInfoVo pageInfoVo){
        return tUserService.getSoftList(pageInfoVo);
    }

    @PostMapping("getType")
    @PostConstruct
    public R getType(){
        System.out.println("已存入缓存");
        return tUserService.getType();
    }
}
